-
Notifications
You must be signed in to change notification settings - Fork 471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug that caused screenview to stay off when screenshare was toggled #7
Conversation
fedfe4d
to
c85d5ab
Compare
@@ -188,6 +188,18 @@ export default class DefaultScreenViewingDeltaRenderer implements ScreenViewingD | |||
} | |||
} | |||
|
|||
hideViewport(): void { | |||
if (this.viewport) { | |||
this.viewport.style.display = 'none'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should modify the CSS styling of the viewport since this is an element that is passed in by the SDK consumer. In particular, they may be controlling the display
attribute themselves and so this could overwrite the attribute. Is there some other way to accomplish the objective here without using CSS styling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, I modified the CSS for the canvas element rather than the exposed viewport.
b71418d
to
339a3f0
Compare
@@ -188,6 +188,18 @@ export default class DefaultScreenViewingDeltaRenderer implements ScreenViewingD | |||
} | |||
} | |||
|
|||
hideViewport(): void { | |||
if (this.viewport) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be if (this.content) {
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Updated.
} | ||
|
||
revealViewport(): void { | ||
if (this.viewport) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be if (this.content) {
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Updated.
339a3f0
to
75d708f
Compare
@@ -434,4 +434,21 @@ describe('DefaultScreenViewingDeltaRenderer', () => { | |||
deltaRenderer.zoomReset(); | |||
}); | |||
}); | |||
|
|||
describe('hideViewport and revealViewport', () => { | |||
it('hides and reveals the viewport', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test does not verify the change made by hideViewport
or revealViewport
. It looks like other tests in this file check properties of the canvas. Could we do the same here?
75d708f
to
2d87e3c
Compare
* Create Chat Application Demo This is taken from https://github.com/aws/amazon-chime-sdk-component-library-react/tree/master/demo/chat which will be deprecated on move. It adds support for authentication via STS lambda. * README has directions for new demo location * Minor README typo fixes Co-authored-by: David Witherspoon <[email protected]>
Issue #:
#6
Description of changes
Added hide and reveal methods to deltaRenderer. This allows screen view to stay open but hidden when screen share closes.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.